package org.web.standardplatform.client.domain.buildcode;

import lombok.Getter;
import lombok.Setter;
import org.web.base.helper.StringHelper;
import org.web.standardplatform.client.builder.SqlConverterHelper;

@Setter
@Getter
public class CodeClassNameDTO {

    private String tableName;

    public CodeClassNameDTO(String tableName) {
        this.tableName = tableName;
    }

    public String getJavaAttributeName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName));
    }

    public String getInitLowerJavaAttributeName() {
        return StringHelper.initLower(getJavaAttributeName());
    }


    public String getDaoClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "DAO");
    }

    public String getDaoObjectName() {
        return StringHelper.initLower(getDaoClassName());
    }

    public String getDomainClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "DO");
    }

    public String getQueryClassName() {
        return StringHelper.initUpper("Query" + StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName)));
    }

    public String getQueryObjectName() {
        return StringHelper.initLower(getQueryClassName());
    }

    public String getDomainObjectName() {
        return StringHelper.initLower(getDomainClassName());
    }


    public String getDtoClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "DTO");
    }

    public String getDtoObjectName() {
        return StringHelper.initLower(getDtoClassName());
    }

    public String getServiceClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "Service");
    }

    public String getControllerClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "Controller");
    }

    public String getControllerObjectName() {
        return StringHelper.initLower(getControllerClassName());
    }

    public String getServiceObjectName() {
        return StringHelper.initLower(getServiceClassName());
    }

    public String getBizName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "Biz");
    }

    public String getQueryDTOClassName() {
        return "Query" + StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "Request");
    }

    public String getQueryDTOObjectName() {
        return StringHelper.initLower(getQueryDTOClassName());
    }

    public String getAttributeName() {
        return StringHelper.initLower(SqlConverterHelper.snakeToCamel(tableName));
    }

    public String getBizClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "Biz");
    }

    public String getBizObjectName() {
        return StringHelper.initLower(getBizClassName());
    }

    public String getBizImplClassName() {
        return StringHelper.initUpper(SqlConverterHelper.snakeToCamel(tableName) + "BizImpl");
    }
}
